﻿
IF object_id(N'dbo.[UDS_Flow]', 'U') IS NULL
BEGIN
    CREATE TABLE [dbo].[UDS_Flow] (
        [Flow_ID]    int            NOT NULL identity(1, 1),
        [Flow_Name]  nvarchar(300)  COLLATE Chinese_PRC_CI_AS NOT NULL,
        [Build_Date] datetime       NOT NULL CONSTRAINT [DF_UDS_Flow_BuildDate] default(getdate()),
        [Builder]    nvarchar(300)  COLLATE Chinese_PRC_CI_AS NULL,
        [Remark]     nvarchar(max)  COLLATE Chinese_PRC_CI_AS NULL,
        [Style_ID]   int            NOT NULL,
    
        CONSTRAINT [PK_UDS_Flow] PRIMARY KEY (Flow_ID asc),
        CONSTRAINT [FK_UDS_Flow_Style_ID] FOREIGN KEY (Style_ID) REFERENCES dbo.UDS_Flow_Style (Style_ID)
    );
END
GO
